#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, x, ans1, ans2;
    cin >> n;
    while (n--)
    {
        cin >> x;
        ans2 = x / 3 * 2;
        ans1 = x - ans2;
        ans2 /= 2;
        while (ans1 - ans2 >= 2)
        {
            ans1 -= 2;
            ans2++;
        }
        cout << ans1 << " " << ans2 << endl;
    }
    return 0;
}